feat(assignments): Cloudinary uploads on submission (closes #1059)#1117
Open
jeromehardaway wants to merge 1 commit into
Open
feat(assignments): Cloudinary uploads on submission (closes #1059)#1117jeromehardaway wants to merge 1 commit into
jeromehardaway wants to merge 1 commit into
Conversation
Closes #1059. Previously the submit page captured file metadata client-side and saved only {name, size} strings — files were never actually persisted. Now files are uploaded to Cloudinary before the submission record is created, and the URLs are stored in Submission.files as JSON. - New /api/upload/file endpoint: server-mediated Cloudinary upload for non-image artifacts (PDF, ZIP, DOC/DOCX, TXT/MD, images). Auth-required; admin secret never leaves the server. 15 MB body limit, resource_type "auto" so non-image types are handled. - Submission page validates size (10 MB per file) and extension client-side before reading the file, then POSTs base64 payloads to /api/upload/file and threads the returned URLs through to the existing submissions endpoint. - File input now uses a proper `accept` filter and shows the user-facing allow-list instead of "Common formats: ZIP, PDF, images".
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Previously the assignment submission page captured file metadata client-side and saved only `{name, size}` to `Submission.files` — actual files were never persisted (`// TODO: Upload files to Cloudinary if provided`).
Closes #1059.
Test plan